<template>
  <div>
    <Table :loading="loading" :columns="columns" :data="listData">
      <template slot-scope="{ row }" slot="master">
          <a @click="show_member(row.master_id)">{{row.master_name}}</a>
      </template>
      <template slot-scope="{ row }" slot="member">
          <a @click="show_member(row.member_id)">{{row.member_name}}</a>
      </template>
    </Table>
   <Modal
      v-model="showUser"
      title="组织者"
      :footer-hide="true"
      :width="60"
    >
      <user-info :member_id="member_id"></user-info>
    </Modal>
  </div>
</template>

<script>
import userInfo from '@/view/components/user/user.vue'
export default {
  name: 'recordList',
  components: {
    userInfo
  },
  props: {
    pageNum: Number,
    loading: Boolean,
    listData: Array
  },
  data () {
    return {
      showUser: false,
      member_id: null,
      columns: [
        {
          title: '记录编号',
          key: 'id',
          align: 'center'
        },
        {
          title: '组织者',
          align: 'center',
          slot: 'master'
        },
        {
          title: '参会人',
          align: 'center',
          slot: 'member'
        },
        {
          title: '加入时间',
          align: 'center',
          key: 'create_time'
        },
        {
          title: '记录IP',
          align: 'center',
          key: 'create_ip'
        }
      ]
    }
  },
  methods: {
    show_member (member_id) {
      this.member_id = member_id
      this.showUser = true
    }
  }
}
</script>

<style lang="" scoped>
</style>
